<script setup lang="ts">
import { useXxx } from './store/xxx'
import { storeToRefs } from 'pinia'
const store = useXxx()
const { state, aaa, getName } = storeToRefs(store)
// storeToRefs就是将pinia模块的数据转换成ref格式
// js访问：state.value   aaa.value
// toRefs
</script>

<template>
  <div class="app-page">
    <h2>{{ state }}</h2>
    <h2>{{ getName }}</h2>
    <button @click="store.setState({ name: '李四' })">修改name</button>
    <hr />
    {{ aaa }}
  </div>
</template>

<style lang="scss" scoped></style>
